#include<bits/stdc++.h>
using namespace std;
using ll=unsigned long long; 

int main(){
	ll n,m;
	cin>>n>>m;
	ll squ=0,rec=0;
	for(ll a=1;a<=min(m,n);a++){
		squ+=(n-a+1)*(m-a+1);
	}
	rec=n*(n+1)*m*(m+1)/4-squ;
	cout<<squ<<" "<<rec<<endl;
	return 0;
} 
